# --**coding:utf-8**--
import element
from selectele.selectClickElement import SelectElement
from drive import Driver


def run():
    d = Driver()
    hierarchy = d.getPageLayout()
    page_activity_name = d.getPageActivityName()
    hierarchy = hierarchy.get('hierarchy')
    if 'node' in hierarchy.keys():
        node = hierarchy.get('node')
        ele_list = element.Element().get_elemant(node)
        ele = SelectElement(element_list=ele_list,d=d)
        ele.getSelectList()
        result = ele.run(page_activity_name=page_activity_name)
        if not result:
            return
    # 獲取 新的 activity
    new_activity_name = d.getNewActivity()
    print new_activity_name